package com.chengda.dashboard.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chengda.dashboard.entity.WorkshopInfo;
import com.chengda.dashboard.mapper.WorkshopInfoMapper;
import com.chengda.dashboard.service.WorkshopInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车间信息服务实现类
 */
@Service
public class WorkshopInfoServiceImpl extends ServiceImpl<WorkshopInfoMapper, WorkshopInfo> implements WorkshopInfoService {

    @Override
    public List<WorkshopInfo> getAllActiveWorkshops() {
        QueryWrapper<WorkshopInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", 1);
        queryWrapper.orderByAsc("workshop_code");
        return list(queryWrapper);
    }

    @Override
    public List<WorkshopInfo> getAllWorkshopInfo() {
        QueryWrapper<WorkshopInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByAsc("workshop_code");
        return list(queryWrapper);
    }
}
